package com.cskaoyan.javase.oop3._2inner._4extend;

/**
 * Java语法间接实现多继承
 *      1.接口
 *      2.内部类
 *
 * @since 15:46
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo {
    public static void main(String[] args) {
        A a = new A();
        a.test();
        a.test2();
        a.method();
    }
}

class A implements IA, IB {
    class BSon extends B{}
    class CSon extends C{}
    class DSon extends D{}

    public void method(){
        new BSon().test();
        new CSon().test();
        new DSon().test();
    }
}

class B {
    void test(){
        System.out.println("b");
    }
}

class C {
    void test(){
        System.out.println("c");
    }
}

class D {
    void test(){
        System.out.println("d");
    }
}

interface IA {
    default void test() {
        System.out.println("ia");
    }
}

interface IB {
    default void test2() {
        System.out.println("ib");
    }
}